package com.boot.controller;

import com.boot.annotation.RateLimit;
import com.boot.entity.Result;
import com.boot.entity.Tag;
import com.boot.service.ITagService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/api/tag")
public class TagController {

    @Resource
    private ITagService tagService;

    /**
     * 查询标签列表
     */
    @RateLimit(limit = 50, windowSec = 60)
    @GetMapping("/listAll")
    public Result<List<Tag>> listTags() {
        return Result.success(tagService.list());
    }
}
